﻿using System;
using System.Xml.Serialization;

namespace Kiva7.DataClasses
{
    public class Payment
    {
        [XmlElement("amount")]
        public double Amount { get; set; }

        [XmlElement("payment_id")]
        public int PaymentId { get; set; }

        [XmlElement("local_amount")]
        public double LocalAmount { get; set; }

        [XmlElement("processed_date")]
        public DateTime? ProcessedDate { get; set; }

        [XmlElement("settlement_date")]
        public DateTime? SettlementDate { get; set; }

        [XmlIgnore]
        public DateTime? SettlementDateOnly 
        {
            get
            {
                if (SettlementDate.HasValue)
                    return SettlementDate.Value.Date;
                else
                    return null;
            }
        }

        [XmlIgnore]
        public string SettlementDateShort
        {
            get
            {
                if (SettlementDate.HasValue)
                    return SettlementDate.Value.ToShortDateString();
                else
                    return null;
            }
        }

        [XmlElement("comment")]
        public string Comment { get; set; }

        [XmlElement("rounded_local_amount")]
        public double RoundedLocalAmount { get; set; }
    }
}
